Skip to content

Conversation

@chedahub
Copy link
Contributor

@chedahub chedahub commented Oct 22, 2025

Description

This PR updates the Intermediate Language (IL) generation for the e_addi and e_add16i instructions on the PowerPC VLE architecture to ensure correct data-flow analysis.

Motivation and Context

For e_addi and e_add16i instructions, the IL was incorrectly interpreting the r0 register as a constant 0 instead of a register source. This was caused by the OTI_GPR0_ZERO flag.

Changes Made

The OTI_GPR0_ZERO flag has been removed.
As a result, r0 is now correctly treated as a general-purpose register in the IL, enabling accurate data-flow analysis.

  • Before: operToIL(il, oper1, OTI_GPR0_ZERO, ...)
  • After: operToIL(il, oper1)

This ensures that r0 is consistently treated as a register operand in the IL for these instruction.

Visual Comparison

  • Before
image image
  • After
image

@chedahub chedahub changed the title Fix(ppc/il): Treat r0 as a register in e_addi/e_add16i IL [PPC-VLE] Fix(ppc/il): Treat r0 as a register in e_addi/e_add16i IL Oct 28, 2025
@plafosse plafosse requested a review from Copilot October 28, 2025 12:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes incorrect Intermediate Language (IL) generation for PowerPC VLE's e_addi and e_add16i instructions by removing the OTI_GPR0_ZERO flag, which was causing register r0 to be incorrectly treated as constant zero instead of as a register operand.

  • Removed OTI_GPR0_ZERO flag from operToIL call for oper1 parameter
  • Register r0 is now correctly treated as a general-purpose register for data-flow analysis
  • Updated IL generation to use default options instead of forcing zero-constant interpretation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@plafosse plafosse merged commit 6f1e52d into Vector35:dev Oct 29, 2025
1 check passed
@plafosse
Copy link
Member

Thanks for the PR! This should be fixed in 5.2.8512

@chedahub chedahub deleted the fix-il-generation branch October 31, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants